package com.demo.controller;


// 用于测试一个类中多个@Bean

import com.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller
public class StudentController5 {
    // 使用属性注入（对于Bean）
    // @Autowired

    // 使用@Resource(name="xx")
   // @Resource(name = "student2")

    // 使用Qualifier
    @Autowired
    @Qualifier(value = "student1")
    private Student student;

    public Student getStudent() {
        return student;
    }

}
